import request from "@/utils/request";

export const preparationTask = {
  contextPath: '/defects', //按照实际应用修改成微服务的名�?//
  getdata: (data) => { //分页查询
    return request({
      url: preparationTask.contextPath + '/en-stock-equip-defect/page',
      method: 'POST',
      data: data
    })
  },
  insertData: (data) => { //新增
    return request({
      url: preparationTask.contextPath + '/t-en-stock-task/insert',
      method: 'POST',
      data: data
    })
  },
  getDefectDataById: (id) => {
    return request({
      url: preparationTask.contextPath + '/en-defects-sheet/' + id,
      method: 'POST'
    })
  },
  getEquipDataById: (id) => {
    return request({
      url: '/equip/t-en-stock-task/getByTaskNo/' + id,
      method: 'POST'
    })
  },
  getPatrolDataById: (id) => {
    return request({
      url: '/patorl/en-patrol-task/getByTaskNo/' + id,
      method: 'POST'
    })
  },

  updateData: (data) => { //修改，删除
    return request({
      url: preparationTask.contextPath + '/t-en-stock-task/update',
      method: 'POST',
      data: data
    })
  },
  queryDictDatasb: (code) => { //获取物资
    return request({
      url: preparationTask.contextPath + '/t-en-wz-sblx/getList?pid=' + code,
      method: 'POST',
      // data: code
    })
  },

  getEquipPage: (data) => { //获取物资
    return request({
      url: preparationTask.contextPath + '/t-en-stock-task/getEquipPage',
      method: 'POST',
      data: data
    })
  },
  getTaskEquipList: (taskNo) => { //根据任务编码获取设备列表
    return request({
      url: preparationTask.contextPath + '/t-en-stock-task/getTaskEquipList/' + taskNo,
      method: 'POST',

    })
  },
  getPatorlTaskEquipList: (taskNo) => { //根据任务编码获取设备列表
    return request({
      url: '/patorl/en-patrol-task/getTaskEquipList/' + taskNo,
      method: 'POST',

    })
  },
  //根据任务编号查询缺陷隐患列表
  getTaskDefectList: (taskNo) => {
    return request({
      url: '/patorl/en-patrol-task/getTaskDefectList/' + taskNo,
      method: 'POST'
    })
  },
  //已处理缺陷隐患列表
  getTaskHandleDefectList: (taskNo) => {
    return request({
      url: '/patorl/en-patrol-task/getTaskHandleDefectList/' + taskNo,
      method: 'POST'
    })
  },
  getElectricityCollectionData: (taskNo) => {
    return request({
      url: '/patorl/en-patrol-task-electricity/getByTaskNo/' + taskNo,
      method: 'GET'
    })
  },
  getEquipStatistics: (code) => {//盘点结果
    return request({
      url: '/equip/t-en-stock-task/getEquipStatisticsByTaskNo/' + code,
      method: 'POST'
    })
  },
  defectDefect: (data) => {
    return request({
      url: '/equip/en-stock-equip-defect/page',
      method: 'POST',
      data: data
    })
  },
}
